﻿using System;

class PrimeInteger
{
    static void Main()
    {
        //Exercise 7.
        //Write an expression that checks if given positive integer number n (n ≤ 100) is prime. E.g. 37 is prime.

        Console.Write("Please enter a positive integer number: ");
        uint number = uint.Parse(Console.ReadLine());
        
        bool check = ((number % 2 > 0) && (number % 3 > 0) && (number % 5 > 0) && (number % 7 > 0)) || 
            ((number == 2) || (number == 3) || (number == 5) || (number == 7));

        Console.WriteLine(check);
        
        // And here is an alternative solution.

        bool isPrime = false;

        for (int number1 = 0; number1 < 100; number1++)
        {
            if ((((number1 % 2 > 0) && (number1 % 3 > 0) && (number1 % 5 > 0) && (number1 % 7 > 0)) ||
            ((number1 == 2) || (number1 == 3) || (number1 == 5) || (number1 == 7))) &&
            (number == number1))
            {
                isPrime = true;
            }
        }
        if (isPrime)
        {
            Console.WriteLine("It's a prime number");
        }
        else
        {
            Console.WriteLine("It is not a prime number");
        }       
    }
}
